Skip to content

feat(automation): continual learning, agents-md-audit, shell entry points#474

Merged
Bryan-Roe merged 1 commit into
mainfrom
cursor/ai-automation-stack-42a0
Jun 21, 2026
Merged

feat(automation): continual learning, agents-md-audit, shell entry points#474
Bryan-Roe merged 1 commit into
mainfrom
cursor/ai-automation-stack-42a0

Conversation

@Bryan-Roe

@Bryan-Roe Bryan-Roe commented Jun 21, 2026

Copy link
Copy Markdown
Owner

Summary

Adds the continual-learning Cursor workflow (skill + memory-updater subagent), a new read-only agents-md-audit inspection agent for AGENTS.md Learned sections, shell/Makefile shortcuts to run repo agents, and documentation fixes for the automation stack.

Changes

  • Added .cursor/agents/agents-memory-updater.md and .cursor/skills/continual-learning/SKILL.md for transcript mining and AGENTS.md memory updates
  • Added scripts/agents/agents_md_audit_agent.py (agents-md-audit) — validates Learned section structure, bullet limits, secret patterns, and stale dates
  • Registered the new agent in scripts/run_repo_agents.py
  • Added scripts/run_ai_automation.sh and Makefile targets (make agents, make agents-dry, make ai-automation)
  • Updated AGENTS.md, scripts/README.md, and REPO_AUTOMATION_GUIDE.md (including fixing --run-agents step order to match code)
  • Created automation status canvas at ~/.cursor/projects/workspace/canvases/automation-status.canvas.tsx (IDE-local artifact)

Verification

  • pytest tests/test_agents_md_audit_agent.py -v — 9 passed
  • ./scripts/run_ai_automation.sh --agent agents-md-audit --dry-run — ok
  • make agents-dry — 4 agents run (2 ok, 2 warning from pre-existing marker/docstring findings)
  • Continual learning is Cursor-native: invoke /continual-learning in chat to delegate to agents-memory-updater
Open in Web Open in Cursor 

Summary by Sourcery

Introduce a new automation agent for auditing AGENTS.md and wire it into the repo automation workflow, alongside continual-learning support and new entry points for running agents.

New Features:

  • Add an agents-md-audit automation agent to validate AGENTS.md Learned sections for structure, bullet limits, stale dates, and secret-like patterns.
  • Add a continual-learning Cursor skill and agents-memory-updater subagent to mine transcripts and keep AGENTS.md Learned sections up to date.
  • Add a run_ai_automation.sh wrapper and Makefile targets to run repository inspection agents via simple shell commands.

Enhancements:

  • Register the new agents-md-audit agent in the repo agent runner so it participates in automation workflows.
  • Document the agents-md-audit agent, new automation entry points, and clarify the ordering of the --run-agents step relative to the integration contract gate.
  • Describe continual-learning usage and automation workflows in AGENTS.md for easier operator guidance.

Tests:

  • Add a dedicated test suite for the agents-md-audit agent covering happy path, error conditions, merge conflicts, bullet limits, stale dates, secret detection, and CLI behavior.

…entry points

Wire continual-learning skill and agents-memory-updater subagent, add a
read-only AGENTS.md audit agent, shell/Makefile shortcuts, and docs for
the expanded repository inspection automation stack.

Co-authored-by: Bryan
Copilot AI review requested due to automatic review settings June 21, 2026 01:52

Copilot AI commented Jun 21, 2026

Copy link
Copy Markdown
Contributor

@Bryan-Roe Thanks for sending me some feedback. Unfortunately, I hit an error while trying to use the custom Copilot setup steps configured for this repository. The error I am seeing is:

no `copilot-setup-steps` job found in your `copilot-setup-steps.yml` workflow file. Please ensure you have a single job named `copilot-setup-steps`. For more details, see https://gh.io/copilot/actions-setup-steps

Once you or someone with the necessary access fixes the problem, please let me know in a comment and I'll try again. Thanks!

@sourcery-ai

sourcery-ai Bot commented Jun 21, 2026

Copy link
Copy Markdown
Contributor

Reviewer's Guide

Implements a new AGENTS.md audit automation agent, wires it into the existing repo automation workflow (including Make/ shell entrypoints), and introduces a Cursor-based continual-learning workflow that keeps AGENTS.md Learned sections in sync with mined transcripts.

Sequence diagram for continual-learning skill and agents-memory-updater workflow

sequenceDiagram
    actor Developer
    participant CursorChat as CursorChat
    participant ContinualLearning as continual-learning
    participant MemoryUpdater as agents-memory-updater
    participant AgentsMd as AGENTS.md
    participant Index as continual-learning-index.json

    Developer->>CursorChat: invoke /continual-learning
    CursorChat->>ContinualLearning: trigger SKILL.md workflow
    ContinualLearning->>MemoryUpdater: call agents-memory-updater

    MemoryUpdater->>AgentsMd: read AGENTS.md
    MemoryUpdater->>Index: read .cursor/hooks/state/continual-learning-index.json
    MemoryUpdater->>MemoryUpdater: mine transcript deltas
    MemoryUpdater->>AgentsMd: update Learned sections (<=12 bullets)
    MemoryUpdater->>Index: write updated incremental index

    MemoryUpdater-->>ContinualLearning: updater result
    ContinualLearning-->>CursorChat: return result
    CursorChat-->>Developer: show updated memory status or "No high-signal memory updates."
Loading

Flow diagram for repo automation entrypoints and agents-md-audit agent

flowchart LR
    Dev[Developer] -->|make agents / make agents-dry| Make
    Dev -->|./scripts/run_ai_automation.sh| Shell
    Dev -->|python scripts/run_repo_agents.py| Runner

    Make --> Runner
    Shell --> Runner

    Runner[scripts/run_repo_agents.py]
    subgraph Agents
        A1[status-freshness]
        A2[marker-audit]
        A3[docstring-audit]
        A4[agents-md-audit]
    end

    Runner --> A1
    Runner --> A2
    Runner --> A3
    Runner --> A4

    A4 --> AGENTS[AGENTS.md Learned sections]
Loading

File-Level Changes

Change Details Files
Add agents-md-audit automation agent to validate AGENTS.md Learned sections and expose a CLI.
  • Implement AgentsMdAuditAgent with structural checks for required Learned sections, bullet count limits, and metrics aggregation.
  • Detect merge conflict markers, potential secret patterns, and stale date references inside Learned bullets using regexes and date parsing.
  • Provide a CLI entrypoint with arguments for repo root, AGENTS.md path, stale date threshold, dry-run behaviour, and JSON output, returning non-zero only on error status.
scripts/agents/agents_md_audit_agent.py
Introduce automated tests for the agents-md-audit agent covering success, failure, and CLI paths.
  • Define a reusable valid AGENTS.md fixture string with both Learned sections and non-stale dates.
  • Test error/warning conditions including missing file, missing section, bullet count limits, merge conflicts, secret patterns, and stale dates.
  • Exercise the main() CLI with dry-run and JSON flags, verifying status.json writing behaviour and printed JSON structure.
tests/test_agents_md_audit_agent.py
Register the new agent in the shared automation orchestration and expose Make and shell entrypoints for running agents.
  • Add the agents_md_audit_agent module to the RUN_AGENTS_MODULES list so it participates in scripts/run_repo_agents.py runs.
  • Define Makefile targets agents, agents-dry, and ai-automation that wrap scripts/run_repo_agents.py with and without --dry-run.
  • Add scripts/run_ai_automation.sh as a .venv-aware wrapper around run_repo_agents.py to simplify local automation invocation.
scripts/run_repo_agents.py
Makefile
scripts/run_ai_automation.sh
Document the new agent, automation entrypoints, and corrected repo_health_automation sequencing across guides and AGENTS.md.
  • Extend REPO_AUTOMATION_GUIDE.md and scripts/README.md agent tables to describe agents-md-audit and its hygiene checks.
  • Document usage of scripts/run_ai_automation.sh and Makefile shortcuts (make agents, make agents-dry) as first-class automation entrypoints.
  • Clarify that repo_health_automation.py --run-agents now runs agents after the integration contract gate and update AGENTS.md usage instructions accordingly, including continual-learning and automation canvas notes.
docs/guides/REPO_AUTOMATION_GUIDE.md
scripts/README.md
AGENTS.md
Add Cursor continual-learning skill and subagent configuration for AGENTS.md memory maintenance.
  • Create a .cursor agents-memory-updater agent spec that defines the transcript-mining and AGENTS.md update workflow, including index management and guardrails on content.
  • Create a .cursor continual-learning skill that acts as an orchestration-only wrapper delegating all work to the agents-memory-updater subagent.
  • Document constraints such as limiting bullets per Learned section, avoiding secrets, and standardizing sections to Learned User Preferences and Learned Workspace Facts.
.cursor/agents/agents-memory-updater.md
.cursor/skills/continual-learning/SKILL.md

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@github-actions github-actions Bot added documentation Improvements or additions to documentation tests scripts labels Jun 21, 2026
@github-actions

Copy link
Copy Markdown

🟡 Coverage — 1b7df20

Metric Value
Total coverage 65.2%
▲ vs main +0.1%
Minimum threshold 60%

Updated on every push · 2026-06-21

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR extends the repository's deterministic automation-agent framework (scripts/agents/) with a new read-only agents-md-audit agent that validates the structure and hygiene of AGENTS.md Learned sections (required sections, bullet limits, merge-conflict markers, secret patterns, and stale dates). It also adds developer entry points (make agents/agents-dry/ai-automation, plus a scripts/run_ai_automation.sh wrapper), wires the agent into the shared run_repo_agents.py orchestration, introduces a Cursor-native continual-learning skill + subagent for keeping AGENTS.md in sync, and corrects documentation (notably the --run-agents ordering, which the code runs after the integration contract gate).

Changes:

  • New agents-md-audit automation agent + dedicated test suite, registered in run_repo_agents.py.
  • New shell/Makefile entry points to run inspection agents from a single command.
  • Continual-learning Cursor skill + agents-memory-updater subagent, with synced docs (AGENTS.md, scripts/README.md, REPO_AUTOMATION_GUIDE.md).

Reviewed changes

Copilot reviewed 10 out of 10 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
scripts/agents/agents_md_audit_agent.py New audit agent; follows the existing AutomationAgent/CLI conventions for parsing, findings, status, and write_status.
tests/test_agents_md_audit_agent.py New tests covering valid/missing/over-limit/secret/stale/CLI paths; fixture embeds a wall-clock-relative date that will eventually flip the "valid" case to a warning.
scripts/run_repo_agents.py Registers the new agent module so it participates in standard runs.
scripts/run_ai_automation.sh New wrapper that hardcodes .venv/bin/python without the venv-fallback used by sibling scripts.
Makefile Adds agents, agents-dry, ai-automation targets and .PHONY entries (help preserved).
scripts/README.md Documents the new agent, entry points, and corrected --run-agents ordering.
docs/guides/REPO_AUTOMATION_GUIDE.md Documents the new agent and corrected (after-gate) --run-agents ordering, verified against code.
AGENTS.md Adds repo-agent and continual-learning usage notes to test/entry-point sections.
.cursor/skills/continual-learning/SKILL.md Orchestration-only skill delegating to the updater subagent.
.cursor/agents/agents-memory-updater.md Subagent definition for transcript-mining and AGENTS.md memory updates.


## Learned Workspace Facts

- Unit test suite passes 2700 tests (as of 2026-06-20).
Comment on lines +3 to +4
REPO_ROOT="$(cd "$(dirname "$0")/.." && pwd)"
exec "${REPO_ROOT}/.venv/bin/python" "${REPO_ROOT}/scripts/run_repo_agents.py" "$@"
@cursor

cursor Bot commented Jun 21, 2026

Copy link
Copy Markdown

Bugbot couldn't run - usage limit reached

Bugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit.

A user or team admin can review and increase usage limits in the Cursor dashboard.

(requestId: serverGenReqId_6abfa7a0-2ede-4e0a-bdbe-6879a754ee3b)

@Bryan-Roe Bryan-Roe marked this pull request as ready for review June 21, 2026 06:29
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@Bryan-Roe Bryan-Roe merged commit 16ea18d into main Jun 21, 2026
50 of 75 checks passed
@Bryan-Roe Bryan-Roe deleted the cursor/ai-automation-stack-42a0 branch June 21, 2026 06:29

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey - I've left some high level feedback:

  • The test_valid_agents_md_passes fixture hardcodes a 2026-06-20 date and uses the default stale_date_days=30, so as time passes this will start failing due to the stale-date check; consider deriving the date dynamically (e.g., using datetime.now() minus a small offset) or overriding stale_date_days to a very large value in that test to keep it stable over time.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- The `test_valid_agents_md_passes` fixture hardcodes a `2026-06-20` date and uses the default `stale_date_days=30`, so as time passes this will start failing due to the stale-date check; consider deriving the date dynamically (e.g., using `datetime.now()` minus a small offset) or overriding `stale_date_days` to a very large value in that test to keep it stable over time.

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@github-actions

Copy link
Copy Markdown

🔐 CodeQL — Open Alerts on this PR

Severity Count
medium 7

Copilot Autofix suggestions (if enabled) appear as inline review comments on the affected lines.
See the full list in the Security tab.

@cursor

cursor Bot commented Jun 21, 2026

Copy link
Copy Markdown

Bugbot couldn't run - usage limit reached

Bugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit.

A user or team admin can review and increase usage limits in the Cursor dashboard.

(requestId: serverGenReqId_e3ecee1a-e640-4045-b89d-428a061e630b)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation scripts tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants